Xen has changed to set-irq-level hypercall from shared-memory PIC stat.
This patch makes IPF accomodate this change
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
case HVMOP_set_param:
argsize = sizeof(xen_hvm_param_t);
break;
+ case HVMOP_set_irq_level:
+ argsize = sizeof(xen_hvm_set_irq_level_t);
+ break;
default:
printk("%s: unknown HVMOP %d\n", __func__, cmd);
return -EINVAL;
{
generate_exirq (vcpu);
}
+
+
+void vmx_vioapic_set_irq(struct domain *d, int irq, int level)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&d->arch.arch_vmx.virq_assist_lock, flags);
+ vioapic_set_irq(d, irq, level);
+ spin_unlock_irqrestore(&d->arch.arch_vmx.virq_assist_lock, flags);
+}
+
+int vmx_vlapic_set_irq(VCPU *v, uint8_t vec, uint8_t trig)
+{
+ int ret;
+ int running = test_bit(_VCPUF_running, &v->vcpu_flags);
+
+ ret = vmx_vcpu_pend_interrupt(v, vec);
+ vcpu_unblock(v);
+ if (running)
+ smp_send_event_check_cpu(v->processor);
+ return ret;
+}
#include <public/version.h>
#include <asm/dom_fw.h>
#include <xen/domain.h>
+#include <asm/vmx.h>
long
do_hvm_op(unsigned long op, XEN_GUEST_HANDLE(void) arg)
break;
}
+ case HVMOP_set_irq_level:
+ {
+ struct xen_hvm_set_irq_level op;
+ struct domain *d;
+
+ if (copy_from_guest(&op, arg, 1))
+ return -EFAULT;
+
+ if (!IS_PRIV(current->domain))
+ return -EPERM;
+
+ d = find_domain_by_id(op.domid);
+ if (d == NULL)
+ return -ESRCH;
+
+ rc = -EINVAL;
+ if (is_hvm_domain(d)) {
+ vmx_vioapic_set_irq(d, op.irq, op.level);
+ rc = 0;
+ }
+
+ put_domain(d);
+ break;
+ }
+
default:
gdprintk(XENLOG_INFO, "Bad HVM op %ld.\n", op);
rc = -ENOSYS;
extern void vmx_relinquish_vcpu_resources(struct vcpu *v);
extern void vmx_die_if_kernel(char *str, struct pt_regs *regs, long err);
extern void vmx_send_assist_req(struct vcpu *v);
+extern void vmx_vioapic_set_irq(struct domain *d, int irq, int level);
static inline vcpu_iodata_t *get_vio(struct domain *d, unsigned long cpu)
{
#define VLAPIC_ID(l) (uint16_t)(((l)->vcpu->arch.privregs->lid) >> 16)
#define VLAPIC_IRR(l) ((l)->vcpu->arch.privregs->irr[0])
struct vlapic *apic_round_robin(struct domain *d, uint8_t vector, uint32_t bitmap);
-extern int vmx_vcpu_pend_interrupt(struct vcpu *vcpu, uint8_t vector);
+extern int vmx_vlapic_set_irq(struct vcpu *v, uint8_t vec, uint8_t trig);
static inline int vlapic_set_irq(struct vlapic *t, uint8_t vec, uint8_t trig)
{
- return vmx_vcpu_pend_interrupt(t->vcpu, vec);
+ return vmx_vlapic_set_irq(t->vcpu, vec, trig);
}
enum ioapic_irq_destination_types {